﻿@model NationalIT.split_expenses
@{
    ViewBag.Title = "Split Expenses";
}
<script type="text/javascript">
    $(document).ready(function () {
        //rdoSplitDriver  rdoSplitOwner chonsen-split-expenses
        var value1 = eval($(".rdoSplitExpenses:checked").val());
        if (value1 == 1) {
            $(".chonsen-split-expenses-owner").next().hide();
            $(".chonsen-split-expenses").next().show();
        } else {
            $(".chonsen-split-expenses-owner").next().show();
            $(".chonsen-split-expenses").next().hide();
        }
        $(".rdoSplitExpenses").change(function () {
            var value = eval($(this).val());
            if (value == 1) {
                $(".chonsen-split-expenses-owner").next().hide();
                $(".chonsen-split-expenses").next().show();
            } else {
                $(".chonsen-split-expenses-owner").next().show();
                $(".chonsen-split-expenses").next().hide();
            }
        });
    });
</script>
<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="box-title">
                <h3>
                    <i class="icon-table"></i>Split Expenses</h3>
            </div>
            <div class="box-content">
                <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
                <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
                @using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-horizontal" }))
                {
                    @Html.ValidationSummary(true)                    

                    @Html.HiddenFor(model => model.Id)
                    
                    <div class="control-group">
                        <label class="control-label" for="Driver">
                            OwnerDriver</label>
                        <div class="controls">
                            <div class="span12">
                                <select data-placeholder="Select OwnerDriver" name="Idndex" class="chosen-with-diselect input-xxlarge chonsen-split-expenses">
                                    @Html.Raw(ViewBag.dataDriver)
                                </select>
                                <select data-placeholder="Select OwnerDriver" name="Idndex2" class="chosen-with-diselect input-xxlarge chonsen-split-expenses-owner">
                                    @Html.Raw(ViewBag.dataOwner)
                                </select>
                                @Html.ValidationMessageFor(model => model.OwnerDriver)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Idndex">
                            Index</label>
                        <div class="controls">
                            <div class="span12">
                                <label class="radio inline">
                                    <input type="radio" name="OwnerDriver" class="rdoSplitExpenses" value="1" @(Model != null?( Model.OwnerDriver == 2 ? "checked" : ""):"checked")>
                                    Driver's expenses
                                </label>
                                <label class="radio inline">
                                    <input type="radio" name="OwnerDriver" class="rdoSplitExpenses" value="2" @(Model != null && Model.OwnerDriver == 1 ? "checked" : "")>
                                    Owner's expenses
                                </label>
                                @Html.ValidationMessageFor(model => model.Idndex)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Expenses">@Html.LabelFor(model => model.Expenses)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Expenses, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.Expenses)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Amount">@Html.LabelFor(model => model.Amount)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Amount, new { @class = "input-xlarge" }) ($)
                                @Html.ValidationMessageFor(model => model.Amount)
                            </div>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="Details">@Html.LabelFor(model => model.Details)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Details, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.Details)
                            </div>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="Date">@Html.LabelFor(model => model.Date)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Date, new { Value = Model != null && Model.Date.HasValue ? Model.Date.Value.ToString("MM/dd/yyyy") : "", @class = "input-xlarge date-picker" })
                                @Html.ValidationMessageFor(model => model.Date)
                            </div>
                        </div>
                    </div> 
                    <div class="control-group">
                        <label class="control-label" for="Fee_Charged">
                        </label>
                        <div class="controls">
                            <label for="Fee_Charged" class="checkbox">
                                Fee Charged
                                @Html.CheckBoxFor(model => model.Fee_Charged, new { @class = "input-xlarge" })</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Current_Payroll">
                        </label>
                        <div class="controls">
                            <label for="Current_Payroll" class="checkbox">
                                Current Payroll
                                @Html.CheckBoxFor(model => model.Current_Payroll, new { @class = "input-xlarge" })</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Paid_Off">
                        </label>
                        <div class="controls">
                            <label for="Paid_Off" class="checkbox">
                                Paid Off
                                @Html.CheckBoxFor(model => model.Paid_Off, new { @class = "input-xlarge" })</label>
                        </div>
                    </div>
                    <div class="form-actions">
                        @Html.Partial("_ShowSaveEdit")
                    </div>
                }
            </div>
        </div>
    </div>
</div>
